package com.dys.hejiayuncommunity.web.controller.system;

import com.dys.hejiayuncommunity.common.core.domain.BaseResponse;
import com.dys.hejiayuncommunity.system.domain.dto.AreaDTO;
import com.dys.hejiayuncommunity.system.service.SysAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @className: com.dys.hejiayuncommunity.web.controller.system.SysAreaController
 * @description: 区域控制器
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/12/05 22:11
 */
@RestController
@RequestMapping(value = "/system/area")
public class SysAreaController {

    @Autowired
    private SysAreaService sysAreaService;

    @GetMapping("/tree")
    public BaseResponse<List<AreaDTO>> getAreaTree() {
        return BaseResponse.success(sysAreaService.findAreaAsTree());
    }
}
